import Vue from 'vue'
import App from './App'

// 引入路由
import VueRouter from 'vue-router'
// 引入组件：
import goods from './components/goods/goods'
import ratings from './components/ratings/ratings'
import seller from './components/seller/seller'

// 初始化路由
Vue.use(VueRouter);

// 配置路由参数
const routes = [{
  path: '/',
  component:goods
}, {
  path: '/goods',
  component: goods
}, {
  path: '/ratings',
  component: ratings
}, {
  path: '/seller',
  component: seller
}];

// 实例化路由，并把配置参数传递进去
const router = new VueRouter({
  routes, // (缩写) 相当于 routes: routes
  linkActiveClass: 'active'
})




new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
